using System;
using Framework.Audio;
using Framework.FSMLite;
using Framework.GamePool.manager;
using Framework.UI;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;

namespace StateSystem.State
{
    public class StateInit : StateMachine<StateSystem.GameState>
    {
        protected override void OnEnter(params object[] args)
        {
            Resources.LoadAll("Fonts & Materials/");
            //初始化所有manager
            this.OldManagerInit();
            AudioManager.Instance.Init(new AudioSourceHandler(AudioManager._AUDIO_Path));
            //其他逻辑，如logo展示等

            //end
            this.stateMachineRunner.OpenState(GameState.GameHome);
        }

        protected override void OnExit()
        {
        }

        protected void OldManagerInit() 
        {
            GameManager.Instance.ToString();
            GamePoolManager.Instance.ToString();
            UIManager.Instance.ToString();
            Account.Instance.ToString();
        }
    }
}